From e9f8582d3ad8154097f68c5566cbf678e53cb44e Mon Sep 17 00:00:00 2001 From: "chris@kneesaa.uk.xensource.com" Date: Wed, 26 Jul 2006 14:26:03 +0100 Subject: [PATCH] [qemu] Use domain-name in VNC window title. Set the VNC window title with domain-name. Signed-off-by: Yang Xiaowei Signed-off-by: Christian Limpach --- tools/ioemu/patches/series | 1 + tools/ioemu/patches/vnc-title-domain-name | 25 +++++++++++++++++++++++ tools/ioemu/vnc.c | 7 +++++-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 tools/ioemu/patches/vnc-title-domain-name diff --git a/tools/ioemu/patches/series b/tools/ioemu/patches/series index 5fc4d15c7f..3ee8646550 100644 --- a/tools/ioemu/patches/series +++ b/tools/ioemu/patches/series @@ -32,3 +32,4 @@ acpi-poweroff-support vnc-cleanup vnc-fixes vnc-start-vncviewer +vnc-title-domain-name diff --git a/tools/ioemu/patches/vnc-title-domain-name b/tools/ioemu/patches/vnc-title-domain-name new file mode 100644 index 0000000000..3fb1491bab --- /dev/null +++ b/tools/ioemu/patches/vnc-title-domain-name @@ -0,0 +1,25 @@ +Index: ioemu/vnc.c +=================================================================== +--- ioemu.orig/vnc.c 2006-07-26 14:23:52.426074956 +0100 ++++ ioemu/vnc.c 2006-07-26 14:24:15.210558295 +0100 +@@ -850,6 +850,7 @@ + + static int protocol_client_init(VncState *vs, char *data, size_t len) + { ++ size_t l; + char pad[3] = { 0, 0, 0 }; + + vs->width = vs->ds->width; +@@ -886,8 +887,10 @@ + + vnc_write(vs, pad, 3); /* padding */ + +- vnc_write_u32(vs, 4); +- vnc_write(vs, "QEMU", 4); ++ l = strlen(domain_name); ++ vnc_write_u32(vs, l); ++ vnc_write(vs, domain_name, l); ++ + vnc_flush(vs); + + vnc_read_when(vs, protocol_client_msg, 1); diff --git a/tools/ioemu/vnc.c b/tools/ioemu/vnc.c index 0450f4bcb8..b2d539ec93 100644 --- a/tools/ioemu/vnc.c +++ b/tools/ioemu/vnc.c @@ -850,6 +850,7 @@ static int protocol_client_msg(VncState *vs, char *data, size_t len) static int protocol_client_init(VncState *vs, char *data, size_t len) { + size_t l; char pad[3] = { 0, 0, 0 }; vs->width = vs->ds->width; @@ -886,8 +887,10 @@ static int protocol_client_init(VncState *vs, char *data, size_t len) vnc_write(vs, pad, 3); /* padding */ - vnc_write_u32(vs, 4); - vnc_write(vs, "QEMU", 4); + l = strlen(domain_name); + vnc_write_u32(vs, l); + vnc_write(vs, domain_name, l); + vnc_flush(vs); vnc_read_when(vs, protocol_client_msg, 1); -- 2.30.2